<?php
/**
 * Created by PhpStorm.
 * User: chy
 * Date: 2017/4/1
 * Time: 17:06
 */
?>
<?php $i=0; foreach ($items as $item){?>
   <?php if($i%2==0){?>
        <div class="news_container clearfix">
            <div class="new">
                <p class="title"><?=$item['title']?></p>
                <p class="date">日期：<?=date('Y-m-d',$item['created_at'])?> | 阅读：<?=$item['views']?>次</p>
                <p class="info"><?=$item['intro']?></p>
                <a href="<?=\yii\helpers\Url::to(['/post', 'id' => $item['id']])?>"><img src="/images/more_flag.png">查看详情</a>
            </div>
        </div>
       <?php }else{?>
        <div class="news_container clearfix">
            <div class="new_img_box">
                <img src="<?=empty($item['face'])?'':$item['face']?>">
            </div>
            <div class="new" style="width: 670px;">
                <p class="title"><?=$item['title']?></p>
                <p class="date">日期：<?=date('Y-m-d',$item['created_at'])?> | 阅读：<?=$item['views']?>次</p>
                <p class="info"><?=$item['intro']?></p>
                <a href="<?=\yii\helpers\Url::to(['/post', 'id' => $item['id']])?>"><img src="/images/more_flag.png">查看详情</a>
            </div>
        </div>
       <?php }?>
<?php $i++; }?>
